package com.sjms._09_结构_享元模式;

import java.util.HashMap;

public class LocalCache implements Cache {
    private static final HashMap<String, Object> cache = new HashMap<>();

    public LocalCache() {
        System.out.println("构造~LocalCache~");
    }

    @Override
    public void set(String key, Object value) {
        cache.put(key, value);
        System.out.println("LocalCache,Set操作，key="+key+" , value="+value);

    }

    @Override
    public Object get(String key) {
        return cache.get(key);
    }
}
